package com.feihong.txgw.shopcar.viewholder;

import android.view.View;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.feihong.txgw.R;
import com.feihong.txgw.adapter.Holder.BaseViewHolder;
import com.feihong.txgw.shopcar.listener.ShopCarDelFailureGoodsListener;
import com.feihong.txgw.ui.activity.base.BaseActivity;

import cn.pedant.SweetAlert.SweetAlertDialog;

/**
 * @name txgw_app
 * @class name：com.feihong.txgw.shopcar.viewholder
 * @class describe:
 * @author wangziheng
 * @time 2017/9/15 17:50
 * @change
 * @chang time
 * @class describe
 */
public class ShopCarFailureDevideViewHolder extends BaseViewHolder {
    private TextView mDelFailureGoodsBtn;
    private BaseActivity mContext;
    private LinearLayout mLayout;
    public ShopCarFailureDevideViewHolder(BaseActivity context,View itemView) {
        super(itemView);
        mContext = context;
        mDelFailureGoodsBtn = (TextView) itemView.findViewById(R.id.shopcar_delete_failure_goods_btn);
        mLayout = (LinearLayout) itemView.findViewById(R.id.shopcar_delete_failure_goods_layout);
    }
    public void initData(final ShopCarDelFailureGoodsListener shopCarDelFailureGoodsListener){

        mDelFailureGoodsBtn.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                mContext.showConfirmDialog(null, "确定要清空过期商品么", "清空", "取消", new SweetAlertDialog.OnSweetClickListener() {
                    @Override
                    public void onClick(SweetAlertDialog sweetAlertDialog) {
                        sweetAlertDialog.cancel();
                        shopCarDelFailureGoodsListener.setOnDelFailureGoodsListener();
                    }
                });
            }
        });
    }
}
